package com.xzy.demo.entry;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
@PropertySource("classpath:sysConfig.properties")/*自动义加载properties*/
public class Person {

    //@Value("${name}")
    private String name;
    private Integer age;
    private boolean sex;
    private Map<String,Object> map;
    private List<String> list;

    public Person() {
    }


    public Person(String name, Integer age, boolean sex, Map<String, Object> map, List<String> list) {
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.map = map;
        this.list = list;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public boolean isSex() {
        return sex;
    }

    public void setSex(boolean sex) {
        this.sex = sex;
    }

    public Map<String, Object> getMap() {
        return map;
    }

    public void setMap(Map<String, Object> map) {
        this.map = map;
    }

    public List<String> getList() {
        return list;
    }

    public void setList(List<String> list) {
        this.list = list;
    }

    @Override
    public String toString() {
        return "TestProperties{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                ", map=" + map +
                ", list=" + list +
                '}';
    }
}
